raise TypeError('message argument must be unicode')
self.buddy_says(buddy, message, type = 'incoming', **options)
def sent_message(self, message, format = None, **options):
if not isinstance(message, unicode):
raise TypeError('message argument must be unicode')
buddy = self.self_buddy
message = message.encode('xml')
if format:
traceguard.__enter__()
try:
message = format_xhtml(message, format)
finally:
pass
self.autoresponded = True
self.buddy_says(buddy, message, type = 'outgoing', **options)
def incoming_message(self, autoresp = True):
status = profile.status.for_account(self.protocol)
StatusMessage = StatusMessage
import common
get_default_format = get_default_format
import gui.uberwidgets.formattedinput
if all((autoresp, status.away, not (status.invisible), status != StatusMessage.Offline, pref('messaging.when_away.autorespond', False), not (self.autoresponded))):
if status.message:
self.autoresponded = True
import wx as wx
def later():
self.autorespond(status.message, format = get_default_format())
later = (None, None, wx.CallAfter)(later)
def __contains__(self, buddy):
bname = get_bname(buddy)
buddy = self.buddies[bname]
return buddy in self.room_list
def tingle(self):
self.system_message('Your digsby sense is tingling!')
def buddy(self):
r = self.room_list[:]
while self.self_buddy in r:
r.remove(self.self_buddy)
if len(r) == 1:
return r[0]
elif self.room_list:
pass
return self.self_buddy
buddy = property(buddy)
def send_typing_status(self, status):
raise NotImplementedError
def exit(self):
raise NotImplementedError
def autorespond(self, msg, format = None, **kws):
if not self.ischat:
if self.buddy.isbot:
log.info('Not sending autoresponse to bot: %r', self.buddy)
return None
if 'has_autotext' not in kws:
kws.update(has_autotext = True)
self.send_message(AUTORESP + msg, auto = True, format = format, **kws)